//
//  WPActionSheetButton.m
//  wobingwoyi
//
//  Created by WGP on 16/9/13.
//  Copyright © 2016年 WGP. All rights reserved.
//

#import "WPActionSheetButton.h"

#define kImageViewWH 50

@implementation WPActionSheetButton

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = [UIFont systemFontOfSize:12];
        [self setTitleColor:GLobalFontColor forState:UIControlStateNormal];
        self.imageView.layer.cornerRadius = kImageViewWH * 0.5;
    }
    return self;
}

#pragma mark 调整图片的位置和尺寸
- (CGRect)imageRectForContentRect:(CGRect)contentRect{
    CGFloat imageW = kImageViewWH;
    CGFloat imageH = kImageViewWH;
    CGFloat imageX = 0;
    CGFloat imageY = 21;
    return CGRectMake(imageX, imageY, imageW, imageH);
}

#pragma mark 调整文字的位置和尺寸
- (CGRect)titleRectForContentRect:(CGRect)contentRect{
    CGFloat titleW = self.frame.size.width;
    CGFloat titleH = 12;
    CGFloat titleX = 0;
    CGFloat titleY = 81;
    return CGRectMake(titleX, titleY, titleW, titleH);
}

@end
